Test Series - Data Structure

Test Number 79/115

Q: In what time can a 2-d tree be constructed?
A. O(N)
B. O(N log N)
C. O(N2)
D. O(M log N)
Solution: A perfectly balanced 2-d tree can be constructed in O(N log N) time. This value is computed mathematically.
Q: In a two-dimensional search tree, the root is arbitrarily chosen to be?
A. even
B. odd
C. depends on subtrees
D. 1
Solution: In a two- dimensional k-d tree (i.e.) 2-d tree, the root is arbitrarily chosen to be an odd level and it applies to all 2-d trees.
Q: Which of the following is the simplest data structure that supports range searching?
A. Heaps
B. binary search trees
C. AA-trees
D. K-d trees
Solution: K-d trees are the simplest data structure that supports range searching and also it achieves the respectable running time.
Q: In a k-d tree, k originally meant?
A. number of dimensions
B. size of tree
C. length of node
D. weight of node
Solution: Initially, 2-d trees were created. Then, 3-d trees, 4-trees etc., where k meant the number of dimensions.
Q: What will be the correct sequence of insertion for the following k-d tree?
A. (30,40),(5,25),(70,70),(10,12),(50,30),(35,45)
B. (40,30),(5,25),(12,10),(70,70),(30,50),(45,35)
C. (30,40),(5,25),(10,12),(70,70),(50,30),(35,45)
D. (40,30),(25,5),(12,10),(70,70),(50,30),(45,35)
Solution: The correct sequence of insertion of the above given tree is (30,40),(5,25),(10,12),(70,70),(50,30),(35,45). The insertion is given by, first left, then right.
Q: Each level in a k-d tree is made of?
A. dimension only
B. cutting and dimension
C. color code of node
D. size of the level
Solution: Each level in a k-d tree is made of dimensions and cutting. Cutting and dimensions are used for insertion, deletion and searching purposes.
Q: What is the worst case of finding the nearest neighbour?
A. O(N)
B. O(N log N)
C. O( log N)
D. O(N3)
Solution: The worst case analysis of finding the nearest neighbour in a k-d tree is mathematically found to be O(N).
Q: What is the run time of finding the nearest neighbour in a k-d tree?
A. O(2+ log N)
B. O( log N)
C. O(2d log N)
D. O( N log N)
Solution: The run time of finding the nearest neighbour in a kd tree is given as O(2d log N) where 2d is the time taken to search the neighbourhood.
Q: Several kinds of queries are possible on a k-d called as?
A. partial queries
B. range queries
C. neighbour queries
D. search queries
Solution: Several range queries are possible on a k-d tree. One of the range queries is known as a partial match query.
Q: Who invented k-d trees?
A. Arne Andersson
B. Jon Bentley
C. Jon Von Newmann
D. Rudolf Bayer
Solution: Jon Bentley found k-d trees. Rudolf Bayer found red black trees. Arne Andersson found AA- trees.

You Have Score    /10